package com.kaishengit.pojo;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
//import org.springframework.transaction.annotation.Transactional;


@Entity
@Table(name="t_files")
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class Files {
	
	private String id;
	private String name;
	private String filename;
	private String filesize;
	private String createtime;
	private String outtime;
	//private String size;
	//private String md5;
	
	private Filetype filetype;
	private User user;
	
	/*private String userid;
	private String filetypeid;
	
	public String getUserid() {
		return userid;
	}
	public void setUserid(String userid) {
		this.userid = userid;
	}
	public String getFiletypeid() {
		return filetypeid;
	}
	public void setFiletypeid(String filetypeid) {
		this.filetypeid = filetypeid;
	}*/
	@Id
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getFilename() {
		return filename;
	}
	public void setFilename(String filename) {
		this.filename = filename;
	}
	public String getFilesize() {
		return filesize;
	}
	public void setFilesize(String filesize) {
		this.filesize = filesize;
	}
	public String getCreatetime() {
		return createtime;
	}
	public void setCreatetime(String createtime) {
		this.createtime = createtime;
	}
	
	/*public String getMd5() {
		return md5;
	}
	public void setMd5(String md5) {
		this.md5 = md5;
	}*/
	
	@ManyToOne
	@JoinColumn(name="filetypeid")
	public Filetype getFiletype() {
		return filetype;
	}
	public void setFiletype(Filetype filetype) {
		this.filetype = filetype;
	}
	
	@ManyToOne
	@JoinColumn(name="userid")
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	/*@
	public String getSize() {
		return size;
	}
	public void setSize(String size) {
		this.size = size;
	}*/
	
	@Transient
	public String getOuttime() {
		return outtime;
	}
	public void setOuttime(String outtime) {
		this.outtime = outtime;
	}
	
	
	
	
	 

}
